package com.gagakuai.framework.task;

import org.camunda.bpm.engine.RuntimeService;
import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.camunda.bpm.engine.delegate.JavaDelegate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/*
 * @program: common-starters
 * @description:
 * @author: houhong
 * @create: 2022-12-13 21:01
 */
@Component
public class ReciveTask  implements JavaDelegate {

    @Autowired
    private RuntimeService runtimeService;

    /*
    *
    * 接收任务需要在这里做任务，因为流程状态定义是暂存在数据库中刮起
     *  然后完成自己的任务，然后触发节点继续向下走
     *  1:接收任务不会在ACT_RU_TASK中
    */
    @Override
    public void execute(DelegateExecution delegateExecution) throws Exception {

        String executionId  ="";
        runtimeService.signal(executionId);
    }


    /*
    *  通过消息触发
    */
    public  void msgSignal(){


        String executionId  ="";
        runtimeService.signal(executionId);
    }


}